import logo from './logo.svg';
import './App.css';
import { Button } from 'antd';

import React, { useState } from 'react';
import {ConfigProvider,Cascader } from 'antd';
import { CheckOutlined } from '@ant-design/icons';
const options = [
  {
    value: 'z',
    label: 'Z',
    children: [
      {
        value: 'h',
        label: 'H',
        children: [
          {
            value: 'xihu',
            label: 'West Lake',
          },
        ],
      },
    ],
  },
  {
    value: 'jiangsu',
    label: 'Jiangsu',
    children: [
      {
        value: 'nanjing',
        label: 'Nanjing',
        children: [
          {
            value: 'zhonghuamen',
            label: 'Zhong Hua Men',
          },
        ],
      },
    ],
  },
];
const customOptionRender = (option) => {
  console.log("option:",option,"isLef:"+option.isLeaf)
  if (option && !option.children) {
    return (
      <span>
        <CheckOutlined style={{ marginRight: 5 }} />
        {option.label}
        
      </span>
    );
  }
  return (
    <span>
      {option.label}
    </span>
  );
};
const onChange = (value) => {
  console.log(value);
};
const App= () =>(
<Cascader  options={options} onChange={onChange}
optionRender={customOptionRender} placeholder="Please select" />)



export default App;
